package com.atguigu.scala.test

/**
 * @author lizikuan
 * @date 2021/5/25 19:46
 */
object Test5 {
  def main(args: Array[String]): Unit = {
    val list = List(1, 2, 3, 4, 5, 6, "test")
    list.filter(_.isInstanceOf[Int]).map(x=>x.asInstanceOf[Int]).map(_+1).foreach(println(_))
    list.filter(_.isInstanceOf[Int]).collect({
      case x:Int=>x+1
    }).foreach(println(_))
  }
}
